package com.itheima.test12;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;

/*
题目二
		请编写main()方法，定义一个字符缓冲输入流BufferedReader，读取test3_2.txt文件，一次读取一行，将读取的内容存储到一个List<String>集合中，遍历、并打印集合中的每个元素：
			//1.定义一个字符缓冲输入流
			BufferedReader in = new BufferedReader(......);
			//2.定义一个集合
			List<String> list = new ArrayList<>();
			//3.一次读取一行
			......
			......
 */
public class Test12 {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new FileReader("D:\\IdeaProjects\\studentManagerSystem\\homewrok0919\\src\\com\\itheima\\test3_2.txt"));
        ArrayList<String> strList = new ArrayList<>();
        String len;
        while ((len = br.readLine()) != null){
//            System.out.println(len);//@【测试】
            strList.add(len);
        }
        br.close();
        for (String s : strList) {
            System.out.println(s);
        }
    }
}
